package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.Map;

/**
 * ClassName: UserMapper
 * Package: com.sky.mapper
 * Description:
 *
 * @Author 朱志辉
 * @Create 2024/5/27 下午4:47
 * @Version 1.0
 */
@Mapper
public interface UserMapper {

    /**
     * 根据openid获取用户信息
     * @param openid
     * @return
     */
    @Select("SELECT * FROM user WHERE openid = #{openid}")
    User getUserById(String openid);

    /**
     * 插入用户信息
     * @param userById
     */
    void insert(User userById);

    /**
     * 根据用户id获取用户信息
     * @param userId
     * @return
     */
    @Select("SELECT * FROM user WHERE id = #{userId}")
    User getById(Long userId);


    /**
     * 根据条件统计用户数量
     * @param map·
     * @return
     */
    Integer countUser(Map map);
}
